global with sharing class MobileAppCustomLoginController {
    
    global String username{get;set;}
    global String password{get;set;}
    
    global MobileAppCustomLoginController () {}
    
    global PageReference forwardToCustomAuthPage() {
        PageReference returnPageRef = null;
        if(URL.getCurrentRequestUrl().getProtocol() != 'https')
        {
            String hostVal = ApexPages.currentPage().getHeaders().get('Host');
            String urlVal = Apexpages.currentPage().getUrl();
            returnPageRef = new PageReference('https://' + hostVal + '/mobileapp' + urlVal);
        }
        return returnPageRef;
    }
    
    global PageReference login() {
        return Site.login(username, password, 'MobileApp_Select_Transaction_Type');
    }

}